how to return variable from transaction Laravel

53

how to return variable from transaction Laravel -

$result = null;
DB::transaction(function () use(&$result) { 
    // logic here
    $result = someGetResult();
});
if ($result != null) {

}

Comments

Submit
0 Comments